import App from "./App";
import uviewPlus from "@/uni_modules/uview-plus";
import mpShare from "@/uni_modules/uview-plus/libs/mixin/mpShare";
import * as Pinia from "pinia";
// #ifndef VUE3
import Vue from "vue";
Vue.config.productionTip = false;
App.mpType = "app";
const app = new Vue({
  ...App,
});
app.$mount();
// #endif

// #ifdef VUE3
import { createSSRApp } from "vue";
import CustomTabbar from "@/components/CustomTabbar.vue"; //底部导航栏
import BackgroundImage from "@/components/BackgroundImage.vue"; //背景图片
import CustomNavBar from "@/components/CustomNavBar.vue"; //顶部导舨栏
import TabsView from "@/components/TabsView.vue"; //分类导航栏
import CheckBox from "@/components/CheckBox.vue"; //复选框
import MyPopup from "@/components/MyPopup.vue"; //弹窗
import ConfirmPopup from "@/components/ConfirmPopup.vue"; //弹窗
import CustomPopup from "@/components/CustomPopup.vue";
import Loading from "@/components/Loading.vue";
import { setBaseUrl } from "@/utils/utils";
export function createApp() {
  const app = createSSRApp(App);
  app.component("CustomTabbar", CustomTabbar);
  app.component("CustomNavBar", CustomNavBar);
  app.component("BackgroundImage", BackgroundImage);
  app.component("TabsView", TabsView);
  app.component("CheckBox", CheckBox);
  app.component("MyPopup", MyPopup);
  app.component("ConfirmPopup", ConfirmPopup);
  app.component("CustomPopup", CustomPopup);
  app.component("Loading", Loading);
  app.config.globalProperties.$url = setBaseUrl;
  app.use(Pinia.createPinia());
  app.mixin(mpShare);
  app.use(uviewPlus);
  return {
    app,
  };
}
// #endif
